package com.myfum.wingplayer.entity
{
	import flash.events.Event;
	import flash.filesystem.File;
	
	import mx.collections.ArrayCollection;

	[Event(name = "refresh", type = "flash.events.Event")]
	[Bindable]
	public class ProgramData extends Serializer
	{
		public function ProgramData(file:File = null)
		{
			_file = file;
		}
		
		public function serialize():void{
			if(file){
				_serialize(file);
				dispatchEvent(new Event("refresh"));
			}
		}
		
		public var name:String;
		public var audiofrom:String;
		public var aspectratio:String;
		public var arrayCollection:ArrayCollection;
		public var screensize:String;
		
		public function get width():Number{
			return Number(aspectratio.split(":")[0]);
		}
		
		public function get height():Number{
			return Number(aspectratio.split(":")[1]);
		}
		
		public function clone():ProgramData{
			var pd:ProgramData = new ProgramData(file);
			pd.serialize();
			return pd;
		}
	}
}